package com.feicheng.service;

import com.feicheng.base.result.Result;
import com.feicheng.entity.PurchaseHeader;
import com.feicheng.model.PurchaseHeaderWithPurchaseItem;
import com.feicheng.model.PurchaseHeaderWithUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;


@FeignClient("PROVIDERPROCUREMENT")
public interface ProviderProcurementController {

    @PostMapping ("/purchase/info")
    Result insertInfo(@RequestBody PurchaseHeaderWithPurchaseItem purchaseHeaderWithPurchaseItem);

    /**
     *
     * @param current                当前页数
     * @param size                   每页几条
     * @param purchaseHeaderWithUser 业务参数（查询条件）
     * @author feng.zhang
     * @return
     */
    @PostMapping("/purchase-header/page/g")
    public Result selectPurchaseHeaderWithUser(
            @RequestParam(defaultValue = "1") Integer current,
            @RequestParam(defaultValue = "10") Integer size,
            @RequestBody PurchaseHeaderWithUser purchaseHeaderWithUser
    );

    /**
     * 门店采购订单详情接口
     *
     * @param purchaseHeaderId 采购头主键
     * @param current
     * @param size
     * @return
     * @autor clin.song
     */
    @PostMapping("/purchase/detail/page/g")
    Result getPurchaseDetail(
            @RequestParam Integer purchaseHeaderId,
            @RequestParam(defaultValue = "1") Integer current,
            @RequestParam(defaultValue = "10") Integer size);

    /**
     * 新增采购订单商品类型下拉框
     * @param
     * @author yue.yang
     * @return
     */
    @PostMapping("/product/type_list/g")
    public Result selectType();

    /**
     * 采购产品名称下拉框接口
     * @param type 业务参数
     * @author shanshan.zhang
     * @return
     */

    @PostMapping("/product/product/list/g")
    public Result selectProduct(@RequestParam String type);

    /**
     * 修改采购订单详情状态
     * @param  purchaseHeader  业务参数
     * @autor huanning.lu
     */

    @PutMapping("/purchase-header/info")
    Result updateState(@RequestBody PurchaseHeader purchaseHeader);
}
